using System;
using System.Collections.Generic;
using System.Text;
using SharksHunter.TransferObjects.Presentation;

namespace SharksHunter.UI.Controls
{
    public class MenuActionButton: IActionButton
    {
        private System.Windows.Forms.ToolStripMenuItem _underlyingButton;

        public MenuActionButton(System.Windows.Forms.ToolStripMenuItem b)
        {
            _underlyingButton = b;
            _underlyingButton.Click +=new EventHandler(underlyingButton_Click);
        }

        void underlyingButton_Click(object sender, EventArgs e)
        {
            if (Click != null)
            {
                Click(sender, e);
            }
        }

        #region IActionButton
        public event EventHandler Click;
        bool IActionButton.Enabled
        {
            get { return _underlyingButton.Enabled; }
            set { _underlyingButton.Enabled = value; }
        }
        #endregion
    }
}
